All Questions
102 questions
0votes
1answer
62views
Bulk conditions evaluation throwing a single RuntimeException exception
Bulk conditions evaluation throwing a single exception of a configurable type for all unfulfilled conditions. It is developed around several design patterns: (1) fluent interface to configure the ...
4votes
1answer
104views
Sequentially bidirectional find the indexes of an element into a collection (after second thought)
The util class to find all the indexes on an element into a Collection supports forward and reverse lookup starting from a given index along with changing the ...
3votes
1answer
229views
A library management system
Following is my code for a library management system. I am pretty new to OOD and trying to learn it. I am specially looking for ways where any design patterns can be useful here. I tried to make ...
-1votes
1answer
69views
Object build while sequential read user input [closed]
The implementation reads sequentially the user's input changing the type to build according to user choices. There are two main components a conditional structural sharing (...
3votes
1answer
104views
Sequentially find the indexes of an element into a collection
Util class to find into a collection the indexes of a given element with multiple occurrences from the first index or relative to a given index. ...
1vote
2answers
92views
Verification job with multiple type of batch verifiers
I have a use case where a verification batch job (non-generic) verifies domains based on its input e.g domain_type, batch_pointer etc. The verification handles it based on the domain type which uses ...
1vote
1answer
129views
Business logic verification template
I have a use case of template design pattern with generics as mentioned below. I have AbstractVerificationHandler that provides template for verification business ...
1vote
1answer
2kviews
How to transform the CompletableFuture response
Context: I have a client app which consumes an API. I want to call this API is async way (using java.net.http.HttpClient) and once I receive this data then I want ...
4votes
1answer
2kviews
Java 2 Player Object Oriented CLI Chess Game
I just finished implementing a Java 2 player CLI chess game, it involves player putting in commands (i.e "move e2 e4" to move or "attack d1 d5" to capture.). I am trying to follow ...
-4votes
2answers
335views
How to design planet class so that it is open for changes? [closed]
The task is to model a Solar system using OOP. The planets are orbiting and its needs to find distances between planets. My approach is something like this. ...
0votes
3answers
98views
What is the elegant way to merge collection of entities with a duplicate field?
I have the following entity, I am getting it in response of REST API. class Account { private String ownerId; private List<String> coOwners; } REST ...
1vote
2answers
110views
Java dependency injection and hiding details of methods in "Database"-class
I recently posted a bunch of code of my to-do list application and after getting some very helpful and good suggestions on how to improve, I took a shot at it! Here's a link to the former post I made -...
6votes
1answer
537views
Using a generic call to access different variations of a method
In the code below, the primary purpose of class MyRNG is to create a single method getMyRandom() that will return a random ...
2votes
2answers
192views
Parking places design
I got a question: Design a parking system. There are 3 types of parking spaces: big, medium and small. Implement ParkingSystem class(int big, int medium, int small)....
2votes
0answers
185views
Design a parking lot [closed]
I have tried to design the parking lot problem. Here is the problem statement. Design a parking lot with multiple floors where customers can park their cars. Each parking floor will have many parking ...